<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>    
<%! 
    //{ id:'011', name:'n1.n1', isParent:true}          { id:221, pId:22, name:"随意勾选 2-2-1", checked:true},
	public String getChildren(int id, int pid, boolean isParent) {
    	String childId = pid + "" + id;
    	String c = String.format("{ id:%s, pId:%d, name:'%s',isParent:%b,checked:false, value:%s}", childId, pid, "子菜单"+childId, isParent, childId);
        //c = String.format("{ \"id\":\"%s\", \"pId\":\"%d\", \"name\":\"%s\",\"isParent\":\"%b\",\"checked\":\"false\", \"value\":\"%s\"}", childId, pid, "子菜单"+childId, isParent, childId);
		return c;
	}
%> 
[
<%
     int pid = Integer.parseInt(request.getParameter("id"));
     for (int i=1; i<5; i++) {
    	 out.println(getChildren(i,pid,i%2 == 0 ? true : false));
    	 if (i < 4) {
    		 out.println(",");	 
    	 }
     }
      
%>
]